package com.huatai.vba.finrecon.threadpool;

import java.util.concurrent.*;

public final class ThreadPool {

	public static ThreadPoolExecutor threadPoolExecutor;

	public static synchronized ThreadPoolExecutor getThreadPoolExecutor() {
		if (threadPoolExecutor == null) {
			threadPoolExecutor = new ThreadPoolExecutor(100, 50, 0, TimeUnit.MILLISECONDS,
					new LinkedBlockingQueue<Runnable>());
		}
		return threadPoolExecutor;
	}

	public static void runTask(Runnable task) {
		threadPoolExecutor.execute(task);
	}

}
